<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    body {
      height: 200vh;
      background-image: linear-gradient(white, black);
    }
  </style>
</head>

<body>
  <button>按钮</button>

  <script>
    document.querySelector('button').addEventListener('click', () => {
      scroll({
        top: 500,
        left: 0,
        behavior: 'smooth'
      })
    })
  </script>
</body>

</html>